package com.ds.infrastructure.hyperspace.console.entity.enums;

public interface TbHandlerEnum {
    /**
     * Handler类型:1(preFlow);2(postFlow)
     */
    enum HANDLER_TYPE {
        PRO_FLOW(1, "preFlow"),
        POST_FLOW(2, "postFlow"),
        PRO_POST_FLOW(3, "preFlow|postFlow(通用处理器)");

        public final Integer code;
        private final String desc;

        HANDLER_TYPE(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static HANDLER_TYPE toEnum(int value) {
            for (HANDLER_TYPE item : HANDLER_TYPE.values()) {
                if (item.code == value) {
                    return item;
                }
            }
            return null;
        }
    }
}
